//
// Created by yangw on 2018-3-6.
//

#ifndef MYMUSIC_WLQUEUE_H
#define MYMUSIC_WLQUEUE_H

#include "queue"
#include "pthread.h"
#include "TSPlayerStatus.h"
#include "LogUtil.h"
extern "C"
{
#include "libavutil/avutil.h"
#include "libavcodec/avcodec.h"
};


class MNQueue {

public:
    std::queue<AVPacket *> queuePacket;
    pthread_mutex_t mutexPacket;
    pthread_cond_t condPacket;
    bool  playStatus = false;
    TSPlayerStatus *playstatus = nullptr;
public:
    MNQueue(TSPlayerStatus *plays);
    ~MNQueue();
    int push(AVPacket *packet);
    int get(AVPacket *packet);
    int size();
    void clearAvpacket();


    int putAvpacket(AVPacket  *packet);
    int getQueueSize();

    int getAvpacket(AVPacket  *packet);

};


#endif //MYMUSIC_WLQUEUE_H
